<template>
	<div style="line-height: 2.7;padding: 15px">
		<div class="box">
			<el-row style="text-align: center">
				<el-col><span style="font-size: 1.5em;font-weight: bold">{{ viewData.sxbt }}</span></el-col>
			</el-row>
      <el-row style="line-height: 2">
        <el-col :span="12"><p>{{viewData.xdbm||'无'}}</p></el-col>
        <el-col :span="12"><span style="float: right">{{ viewData.xdrq}}</span></el-col>
      </el-row>
		</div>
		<div class="box">
			<el-row>
				<label>事项性质：</label>
				<div style="display: inline" v-for="dic in sxxzDics" v-if="dic.dictValue==viewData.sxxz">
					{{dic.dictLabel}}
				</div>
			</el-row>
      <el-row>
        <label>事项类型：</label>
        <div style="display: inline" v-for="dic in sxlxDict" v-if="dic.dictValue==viewData.sxlx">
          {{dic.dictLabel}}
        </div>
      </el-row>
			<el-row>
				<label>紧急程度：</label>
				<div style="display: inline" v-for="dic in jjcdDics" v-if="dic.dictValue==viewData.jjcd">
					{{dic.dictLabel}}
				</div>
			</el-row>
			<el-row>
				<label>是否反馈：</label>
				<div style="display: inline" v-for="dic in sffkDics" v-if="dic.dictValue==viewData.sffk">
					{{dic.dictLabel}}
				</div>
			</el-row>
			<el-row>
				<label>截止日期：</label>
				<div style="display: inline" :class="{colorHong:viewData.cqts>0}">
					<span>{{ viewData.jzrq}}</span>
					<span style="margin-left: 10px;"" v-if="viewData.cqts>0">超期{{ viewData.cqts}}天</span>
				</div>
			</el-row>
			<el-row>
				<label>下达人：</label>
				<span>{{ viewData.xdr}}</span>
			</el-row>
			<el-row>
				<label>联系电话：</label>
				<span>{{ viewData.lxdh}}</span>
				<i style="color: #003cff;" class="el-icon-phone"></i>
			</el-row>
		</div>
		<div class="box">
			<el-row>
				<label>相关文件：</label>
				<el-link icon="el-icon-document-remove" style="display: block;color: #577cfa"
					v-for=" img in fileListView " :href="img.wjdz" target="_blank" :download="img.wjmc">
					{{ img.wjmc}}
				</el-link>
			</el-row>
		</div>
    <div class="box">
      <el-row>
        <label>下达内容：</label>
        <uni-forms-item label="" name="xdnr">
          <uni-easyinput disabled  autoHeight  type="textarea"  v-model="viewData.xdnr"/>
        </uni-forms-item>
      </el-row>
    </div>
		<div class="box">
			<el-col :span="24">
			  <div style="height: 70px;display: flex;justify-content: space-between;margin-top: 20rpx;margin-bottom: 20rpx;">
				<span>下达：{{ viewData.xdsl }}</span>
				<span>未反馈：{{ viewData.wfk }}</span>
				<span style="color: #bd3225">未读：{{ viewData.wdsl }}</span>
				<span style="color: #1087fa">已读：{{ viewData.ydsl }}</span>
				<span style="color: #577823">已反馈：{{ viewData.yfk }}</span>
			  </div>
			</el-col>
		</div>
    <el-col>
      <el-button @click="toList(1)" type="primary" round style="width: 100%;">查看审批详情 > > ></el-button>
    </el-col>
    <el-col>
      <el-button @click="toList(2)" type="primary" round style="width: 100%;">查看人员反馈详情 > > ></el-button>
    </el-col>
	</div>

</template>

<script>
	import { getAppZjxdRwbInfo } from "@/api/system/yjgl";
	import { getToken , getUsername} from "@/utils/auth";
	import { getDicts } from "@/api/system/dict/data";
	import config from '@/config';
	export default {
		name: "ckRwxx",
		data() {
			return {
				sxxzDics: [],
        sxlxDict: [],
				sffkDics: [],
				jjcdDics: [],
				fkztDics: [],
				viewData: {},
				fileListView: [],
				sid: "",
				viewTxlPageParams: {
					total: 0,
					page: 1,
					limit: 10
				}
			}
		},
		onLoad(options) {
			this.sid = options.sid;
			this.username = getUsername();
		},
		created() {
			// 字典翻译
      getDicts("sxlx").then(response => {
        for (let item of response.data) {
          this.sxlxDict = response.data;
        }
      });
			getDicts("sxxz").then(response => {
				this.sxxzDics = response.data;
			});
			getDicts("sffk").then(response => {
				this.sffkDics = response.data;
			});
			getDicts("jjcd").then(response => {
				this.jjcdDics = response.data;
			});
			getDicts("fkzt").then(response => {
				this.fkztDics = response.data;
			});
			getAppZjxdRwbInfo({sid: this.sid, username: this.username }).then(res => {
				this.viewData = res.data;
				this.fileListView = res.data.fjbs;
			});
		},
		methods:{
			toList(index){
        if (index == 1)
				this.$tab.navigateTo("/pages/home/step/ckList?sid=" + this.sid);
        if (index ==2)
				this.$tab.navigateTo("/pages/home/step/ckUserList?sid=" + this.sid);
			}
		}
	}
</script>

<style scoped>

	page {
		background-color: #ffffff;
	}

	.box {
		border-bottom: solid #999696 1px;
	}

	label {
		margin-right: 5px;
	}

	.colorHong {
		color: red;
	}
</style>
